﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/HomeSite.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<TimeTableManagement.Controllers.AssignCourse>>" %>

<%@ Register Assembly="DevExpress.Web.v11.1, Version=11.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>

<%@ Register assembly="DevExpress.Web.v11.1, Version=11.1.7.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxPanel" tagprefix="dx" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<div id="addcourse" title="Registry More Course">
        <%--Dang ky them mon--%>
        <% Html.RenderPartial("View/Lecturer/RegistryCourse", Model); %>
</div>
<div id="editprior" title="Edit Prior">
        <%--Dang ky them mon--%>
        <% Html.RenderPartial("View/Lecturer/EditPrior", Model); %>
</div>
    <dx:ASPxRoundPanel ID="ASPxRoundPanel1" runat="server" Width="100%" 
        CssFilePath="~/App_Themes/Aqua/{0}/styles.css" CssPostfix="Aqua" 
        GroupBoxCaptionOffsetY="-28px" 
        SpriteCssFilePath="~/App_Themes/Aqua/{0}/sprite.css">
        <ContentPaddings Padding="14px" />
        <PanelCollection>
<dx:PanelContent runat="server" SupportsDisabledAttribute="True">
<%: Html.ValidationSummary(true) %>
<table style="width:100%" id="t1" class="example table-autosort
 table-autofilter table-autopage:10 
 table-stripeclass:alternate 
 table-page-number:t1page table-page-count:t1pages 
 table-filtered-rowcount:t1filtercount 
 table-rowcount:t1allcount">
<thead>
        <tr>
            <th> Ưu tiên</th>
            <th>
                Mã Môn</th>
            <th>
                Tên</th>
            <th>
                Tín Chỉ</th>
            <th>
                Khoa</th>
            
        </tr>
 </thead>   
 <tbody>
    <% foreach (var item in Model)
    { %>
        <%
            TimeTableManagement.QLSVContext db = new TimeTableManagement.QLSVContext();
            TimeTableManagement.Entities.Tb_Course course = db.Tb_Course.Find(item.id);
        %>
            <td>
                <%: item.prior %></td>
            <td>
                <%: course.code %></td>
            <td>
                <%: course.name %></td>
            <td>
                <%: course.credit %></td>
            <td>
                <%: course.Tb_Department.name %></td>
        </tr>
        <% } %>
        </tbody>  
        <tfoot>
	<tr>
		<td class="table-page:previous" style="cursor:pointer; text-align:right"><img src="../../Content/iconprevious.png" /></td>
		<td style="text-align:center" colspan="3" class="table-page-number:t1page">Page <span id="t1page"></span>&nbsp;of&nbsp;<span id="t1pages"></span></td>
        <td class="table-page:next" style="cursor:pointer; text-align:left"> <img src="../../Content/iconnext.png" /></td>
	</tr>
</tfoot>  
    </table>
    <p><a href="#" onclick="jQuery('#addcourse').dialog('open'); return false">Đăng ký thêm môn</a> | 
    <a href="#" onclick="jQuery('#editprior').dialog('open'); return false">Thay đổi thứ tự ưu tiên</a>
    </p>
</dx:PanelContent>
</PanelCollection>
    </dx:ASPxRoundPanel>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
<script type="text/javascript">
    $(function () {
        $("#addcourse").dialog({
            bgiframe: true,
            height: 400,
            width: 800,
            modal: true,
            autoOpen: false,
            resizable: false
        })
    });
        
    </script>
    <script type="text/javascript">
        $(function () {
            $("#editprior").dialog({
                bgiframe: true,
                height: 400,
                width: 800,
                modal: true,
                autoOpen: false,
                resizable: false
            })
        });
        
    </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="leftmenu" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="menuright" runat="server">
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="Footer" runat="server">
</asp:Content>
